from ultralytics import YOLO

if __name__ == '__main__':
    ship_model = YOLO('D:/PycharmProjects/yolo_v8/detection/yolov8x.pt')
    # 训练模型
    ship_model.train(
        data='ship_license.yaml',  # 数据集配置文件
        epochs=64,  # 训练轮数
        batch=4,  # 批次大小
        optimizer="SGD",  # 优化器
        lr0=1e-3,  # 初始学习率
        lrf=0.005,
        momentum=0.9,
    )
